import axios from "../../../axios";
import api from "./api";

export const userLogin = (data) => {
  return axios({
    method: "post",
    url: api.user.login,
    data
  })
}
export const getInfo = () => {
  return axios({
    method: "get",
    url: api.user.getInfo,
    headers: {
      "Authorization": window.localStorage.getItem('token')
    }
  })
}

export const uploadAvatar = (data) => {
  return axios({
    method: "post",
    url: "/api/prod-api/common/upload",
    headers: {
      "Authorization": window.localStorage.getItem('token')
    },
    data
  })
}

export const updateUser = (data) => {
  return axios({
    method: "put",
    url: "/api/prod-api/api/common/user",
    headers: {
      "Authorization": window.localStorage.getItem('token')
    },
    data
  })
}